<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="Permissions-Policy" content="microphone=*; camera=*;">
	<title>WebRTC</title>
</head>

<body></body>

<script>
	function getUrlQueryParams() {
		let obj = getQueryParams()
		console.log('getQueryParams----', obj)
		if (obj.handleICECandidate) {
			console.log('handleICECandidate发生变化')
			localStorage.setItem('handleICECandidate', obj.handleICECandidate)

		}
		if (obj.callConnected) {
		console.log('callConnected发生变化')
			localStorage.setItem('callConnected', obj.callConnected)

		}
		if (obj.customMessage) {
			console.log('customMessage发生变化')
			localStorage.setItem('customMessage', obj.customMessage)

		}
		if (obj.callOffer) {
			console.log('中转callOffer发生变化')
			localStorage.setItem('callOffer', obj.callOffer)
			localStorage.setItem('callOffer2', '中转callOffer发生变化1')

		}
		if (obj.WebRtcConfig) {
			console.log('WebRtcConfig发生变化')
			localStorage.setItem('WebRtcConfig2', obj.WebRtcConfig)

		}
		

	}
	// 获取路径上的参数
	function getQueryParams() {
		var queryString = location.search;
		var queryParams = {};
		if (queryString.indexOf('?') === 0) {
			queryString = queryString.substring(1);
		}
		var pairs = queryString.split('&');
		for (var i = 0; i < pairs.length; i++) {
			var pair = pairs[i].split('=');
			var key = decodeURIComponent(pair[0]);
			var value = decodeURIComponent(pair[1]);
			queryParams[key] = value;
		}
		return queryParams;
	}

	getUrlQueryParams()

</script>

</html>